package com.example.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.client.elc.ElasticsearchAggregations;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 小岁
 * @version 2023/10/24 18:32
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Document(indexName="post_index", createIndex = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PostIndex implements Serializable {
    @Id
    @Field(type = FieldType.Integer)
    private String id;

    @Field(type = FieldType.Integer,name = "pos_id")
    private Integer posId;
    //职位名

    //    @Field(type= FieldType.Keyword)
//    @Field(type = FieldType.Auto)
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word",name = "pos_name")
    private String posName;


    //职位描述
    @Field(type= FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word",name = "pos_description")
    private String posDescription;

    @Field(type= FieldType.Text ,analyzer = "ik_smart", searchAnalyzer = "ik_smart",name = "pos_keyword")
    private String posKeyword;


    @Field(type= FieldType.Text ,analyzer = "ik_smart", searchAnalyzer = "ik_smart",name = "recruitment_agency")
    private String recruitmentAgency;

//    @Field(type= FieldType.Auto ,analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
//    @Field(type = FieldType.Auto)
//    private String companyName;
//    @Field(type = FieldType.Text)
//    private String companyIntro;
//    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
//    private Date setUpTime;

    //expDemand -工作经验要求
    @Field(name = "exp_demand")
    private String expDemand;


    //工作地点
    @Field(type= FieldType.Text,name = "work_place")
    private String workPlace;

    @Field(name = "publish_time",type = FieldType.Date)
    private Date publishTime;
//    @Field(type= FieldType.Date,format = DateFormat.date_hour_minute_second,name = "publish_time")
//    private Date publishTime;

    @Field(type = FieldType.Text)
    private String background;
    @Field(name = "jr_id")
    private Integer jrId;
    @Field(name = "pay_floor")
    private Integer payFloor;
    @Field(name = "pay_upper")
    private Integer payUpper;

    @Field(name ="specialty" )
    private String specialty;
    @Field(name = "age_demand")
    private String ageDemand;
    @Field(name = "job_benefits")
    private String jobBenefits;


    @Field(name ="jr_name" )
    private String jrName;
    @Field(name ="jr_type" )
    private String jrType;
    @Field(name ="jr_avatar" )
    private String jrAvatar;
    @Field(name = "jr_position")
    private String jrPosition;
    @Field(name ="company_type" )
    private String companyType;
    @Field(name = "run_state")
    private Integer runState;
    @Field(name = "employees_quantity")
    private Integer employeesQuantity;
    @Field(name ="company_name",type = FieldType.Text)
    private String companyName;

}
